package com.xxx.test;

import com.xxx.DAO.booksDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/deleteBook")
public class deleteBook extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String bName=new String(request.getParameter("bName").getBytes("UTF-8"),"UTF-8");
        System.out.println(bName);
        booksDao dao=new booksDao();
        dao.delete(bName);
        request.getRequestDispatcher("showTable2").forward(request,response);
    }
}
